<template>
    <van-nav-bar
      :title="navBarInfo.title"
      v-if="navBarInfo.navBarShow"
      style="height: 1.22667rem;"
      fixed
      placeholder
      @click-left="handleBack"
      border
    >
        <template #left>
          <van-icon name="arrow-left" size="1.5em" color="#000" />
        </template>
    </van-nav-bar>
</template>

<script lang="ts">
import { defineComponent,computed } from 'vue'
import router from '../config/router';
import {useRoute} from 'vue-router'
export default defineComponent({
    setup(){
    const route = useRoute();
    const navBarInfo = computed(() => {
      return route.meta
    })
    const handleBack = () => {
      console.log('返回')
      router.back();
    };

    return {
      handleBack,
      navBarInfo
    }
  }
})
</script>


<style lang="less" scoped>
.nav-icon {
    color: red;
}
</style>